import { FC, useEffect } from 'react';
import SimpleList from '@/components/SimpleList';
import { useModel } from 'umi';
const columns: any[] = [
  {
    title: '登记号',
    dataIndex: 'W001',
    width: 226,
  },
  {
    title: '作品名称',
    dataIndex: 'W002',
    width: 138,
  },
  {
    title: '作品类别',
    dataIndex: 'W003',
    width: 131,
  },
  {
    title: '著作批准时间',
    dataIndex: 'W005',
    width: 194,
  },
  {
    title: '版本号',
    dataIndex: 'W006',
    width: 164,
  },
];

const WorksCopyright: FC = () => {
  const { works, getWorks } = useModel('company');
  useEffect(() => {
    const id = window.sessionStorage.getItem('companyId') || '';
    getWorks({ id });
  }, []);
  return (
    <SimpleList
      width={848}
      height={220}
      columns={columns}
      dataSource={works}
      headerStyle={{
        height: 42,
        backgroundColor: 'rgba(141, 141, 141, 0.1)',
      }}
      rowStyle={{
        height: 42,
      }}
      sortStyle={{
        width: 88,
      }}
      hover
      odd
      rowBackground
    />
  );
};
export default WorksCopyright;
